﻿using Newtonsoft.Json;

namespace DCOWebhook.Models
{
    public class WebhookPayload
    {
        [JsonProperty("repository")]
        public Repository Repository { get; set; }

        [JsonProperty("pusher")]
        public Pusher Pusher { get; set; }

        [JsonProperty("commits")]
        public List<Commit> Commits { get; set; }

        [JsonProperty("ref")]
        public string Ref { get; set; }

        [JsonProperty("before")]
        public string Before { get; set; }

        [JsonProperty("after")]
        public string After { get; set; }
    }

    public class Repository
    {
        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("owner")]
        public Owner Owner { get; set; }
    }

    public class Owner
    {
        [JsonProperty("name")]
        public string Name { get; set; }
    }

    public class Pusher
    {
        [JsonProperty("name")]
        public string Name { get; set; }
    }
}
